3.4.63 \(\int \frac {a+b x^2}{x \sqrt {-c+d x} \sqrt {c+d x}} \, dx\) [363]

Optimal. Leaf size=56 \[ \frac {b \sqrt {-c+d x} \sqrt {c+d x}}{d^2}+\frac {a \tan ^{-1}\left (\frac {\sqrt {-c+d x} \sqrt {c+d x}}{c}\right )}{c} \]

[Out]

a*arctan((d*x-c)^(1/2)*(d*x+c)^(1/2)/c)/c+b*(d*x-c)^(1/2)*(d*x+c)^(1/2)/d^2

________________________________________________________________________________________

Rubi [A]
time = 0.05, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {471, 94, 211} \begin {gather*} \frac {a \text {ArcTan}\left (\frac {\sqrt {d x-c} \sqrt {c+d x}}{c}\right )}{c}+\frac {b \sqrt {d x-c} \sqrt {c+d x}}{d^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*x^2)/(x*Sqrt[-c + d*x]*Sqrt[c + d*x]),x]

[Out]

(b*Sqrt[-c + d*x]*Sqrt[c + d*x])/d^2 + (a*ArcTan[(Sqrt[-c + d*x]*Sqrt[c + d*x])/c])/c

Rule 94

Int[1/(Sqrt[(a_.) + (b_.)*(x_)]*Sqrt[(c_.) + (d_.)*(x_)]*((e_.) + (f_.)*(x_))), x_Symbol] :> Dist[b*f, Subst[I
nt[1/(d*(b*e - a*f)^2 + b*f^2*x^2), x], x, Sqrt[a + b*x]*Sqrt[c + d*x]], x] /; FreeQ[{a, b, c, d, e, f}, x] &&
 EqQ[2*b*d*e - f*(b*c + a*d), 0]

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 471

Int[((e_.)*(x_))^(m_.)*((a1_) + (b1_.)*(x_)^(non2_.))^(p_.)*((a2_) + (b2_.)*(x_)^(non2_.))^(p_.)*((c_) + (d_.)
*(x_)^(n_)), x_Symbol] :> Simp[d*(e*x)^(m + 1)*(a1 + b1*x^(n/2))^(p + 1)*((a2 + b2*x^(n/2))^(p + 1)/(b1*b2*e*(
m + n*(p + 1) + 1))), x] - Dist[(a1*a2*d*(m + 1) - b1*b2*c*(m + n*(p + 1) + 1))/(b1*b2*(m + n*(p + 1) + 1)), I
nt[(e*x)^m*(a1 + b1*x^(n/2))^p*(a2 + b2*x^(n/2))^p, x], x] /; FreeQ[{a1, b1, a2, b2, c, d, e, m, n, p}, x] &&
EqQ[non2, n/2] && EqQ[a2*b1 + a1*b2, 0] && NeQ[m + n*(p + 1) + 1, 0]

Rubi steps

\begin {align*} \int \frac {a+b x^2}{x \sqrt {-c+d x} \sqrt {c+d x}} \, dx &=\frac {b \sqrt {-c+d x} \sqrt {c+d x}}{d^2}+a \int \frac {1}{x \sqrt {-c+d x} \sqrt {c+d x}} \, dx\\ &=\frac {b \sqrt {-c+d x} \sqrt {c+d x}}{d^2}+(a d) \text {Subst}\left (\int \frac {1}{c^2 d+d x^2} \, dx,x,\sqrt {-c+d x} \sqrt {c+d x}\right )\\ &=\frac {b \sqrt {-c+d x} \sqrt {c+d x}}{d^2}+\frac {a \tan ^{-1}\left (\frac {\sqrt {-c+d x} \sqrt {c+d x}}{c}\right )}{c}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.09, size = 54, normalized size = 0.96 \begin {gather*} \frac {b \sqrt {-c+d x} \sqrt {c+d x}}{d^2}+\frac {2 a \tan ^{-1}\left (\frac {\sqrt {-c+d x}}{\sqrt {c+d x}}\right )}{c} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*x^2)/(x*Sqrt[-c + d*x]*Sqrt[c + d*x]),x]

[Out]

(b*Sqrt[-c + d*x]*Sqrt[c + d*x])/d^2 + (2*a*ArcTan[Sqrt[-c + d*x]/Sqrt[c + d*x]])/c

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(107\) vs. \(2(48)=96\).
time = 0.30, size = 108, normalized size = 1.93

method result size
default \(\frac {\left (-\ln \left (-\frac {2 \left (c^{2}-\sqrt {-c^{2}}\, \sqrt {d^{2} x^{2}-c^{2}}\right )}{x}\right ) a \,d^{2}+b \sqrt {-c^{2}}\, \sqrt {d^{2} x^{2}-c^{2}}\right ) \sqrt {d x -c}\, \sqrt {d x +c}}{\sqrt {d^{2} x^{2}-c^{2}}\, d^{2} \sqrt {-c^{2}}}\) \(108\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x^2+a)/x/(d*x-c)^(1/2)/(d*x+c)^(1/2),x,method=_RETURNVERBOSE)

[Out]

(-ln(-2*(c^2-(-c^2)^(1/2)*(d^2*x^2-c^2)^(1/2))/x)*a*d^2+b*(-c^2)^(1/2)*(d^2*x^2-c^2)^(1/2))*(d*x-c)^(1/2)*(d*x
+c)^(1/2)/(d^2*x^2-c^2)^(1/2)/d^2/(-c^2)^(1/2)

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 37, normalized size = 0.66 \begin {gather*} -\frac {a \arcsin \left (\frac {c}{d {\left | x \right |}}\right )}{c} + \frac {\sqrt {d^{2} x^{2} - c^{2}} b}{d^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/x/(d*x-c)^(1/2)/(d*x+c)^(1/2),x, algorithm="maxima")

[Out]

-a*arcsin(c/(d*abs(x)))/c + sqrt(d^2*x^2 - c^2)*b/d^2

________________________________________________________________________________________

Fricas [A]
time = 2.66, size = 61, normalized size = 1.09 \begin {gather*} \frac {2 \, a d^{2} \arctan \left (-\frac {d x - \sqrt {d x + c} \sqrt {d x - c}}{c}\right ) + \sqrt {d x + c} \sqrt {d x - c} b c}{c d^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/x/(d*x-c)^(1/2)/(d*x+c)^(1/2),x, algorithm="fricas")

[Out]

(2*a*d^2*arctan(-(d*x - sqrt(d*x + c)*sqrt(d*x - c))/c) + sqrt(d*x + c)*sqrt(d*x - c)*b*c)/(c*d^2)

________________________________________________________________________________________

Sympy [C] Result contains complex when optimal does not.
time = 28.48, size = 178, normalized size = 3.18 \begin {gather*} - \frac {a {G_{6, 6}^{5, 3}\left (\begin {matrix} \frac {3}{4}, \frac {5}{4}, 1 & 1, 1, \frac {3}{2} \\\frac {1}{2}, \frac {3}{4}, 1, \frac {5}{4}, \frac {3}{2} & 0 \end {matrix} \middle | {\frac {c^{2}}{d^{2} x^{2}}} \right )}}{4 \pi ^{\frac {3}{2}} c} + \frac {i a {G_{6, 6}^{2, 6}\left (\begin {matrix} 0, \frac {1}{4}, \frac {1}{2}, \frac {3}{4}, 1, 1 & \\\frac {1}{4}, \frac {3}{4} & 0, \frac {1}{2}, \frac {1}{2}, 0 \end {matrix} \middle | {\frac {c^{2} e^{2 i \pi }}{d^{2} x^{2}}} \right )}}{4 \pi ^{\frac {3}{2}} c} + \frac {b c {G_{6, 6}^{6, 2}\left (\begin {matrix} - \frac {1}{4}, \frac {1}{4} & 0, 0, \frac {1}{2}, 1 \\- \frac {1}{2}, - \frac {1}{4}, 0, \frac {1}{4}, \frac {1}{2}, 0 & \end {matrix} \middle | {\frac {c^{2}}{d^{2} x^{2}}} \right )}}{4 \pi ^{\frac {3}{2}} d^{2}} + \frac {i b c {G_{6, 6}^{2, 6}\left (\begin {matrix} -1, - \frac {3}{4}, - \frac {1}{2}, - \frac {1}{4}, 0, 1 & \\- \frac {3}{4}, - \frac {1}{4} & -1, - \frac {1}{2}, - \frac {1}{2}, 0 \end {matrix} \middle | {\frac {c^{2} e^{2 i \pi }}{d^{2} x^{2}}} \right )}}{4 \pi ^{\frac {3}{2}} d^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x**2+a)/x/(d*x-c)**(1/2)/(d*x+c)**(1/2),x)

[Out]

-a*meijerg(((3/4, 5/4, 1), (1, 1, 3/2)), ((1/2, 3/4, 1, 5/4, 3/2), (0,)), c**2/(d**2*x**2))/(4*pi**(3/2)*c) +
I*a*meijerg(((0, 1/4, 1/2, 3/4, 1, 1), ()), ((1/4, 3/4), (0, 1/2, 1/2, 0)), c**2*exp_polar(2*I*pi)/(d**2*x**2)
)/(4*pi**(3/2)*c) + b*c*meijerg(((-1/4, 1/4), (0, 0, 1/2, 1)), ((-1/2, -1/4, 0, 1/4, 1/2, 0), ()), c**2/(d**2*
x**2))/(4*pi**(3/2)*d**2) + I*b*c*meijerg(((-1, -3/4, -1/2, -1/4, 0, 1), ()), ((-3/4, -1/4), (-1, -1/2, -1/2,
0)), c**2*exp_polar(2*I*pi)/(d**2*x**2))/(4*pi**(3/2)*d**2)

________________________________________________________________________________________

Giac [A]
time = 0.62, size = 55, normalized size = 0.98 \begin {gather*} -\frac {2 \, a \arctan \left (\frac {{\left (\sqrt {d x + c} - \sqrt {d x - c}\right )}^{2}}{2 \, c}\right )}{c} + \frac {\sqrt {d x + c} \sqrt {d x - c} b}{d^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((b*x^2+a)/x/(d*x-c)^(1/2)/(d*x+c)^(1/2),x, algorithm="giac")

[Out]

-2*a*arctan(1/2*(sqrt(d*x + c) - sqrt(d*x - c))^2/c)/c + sqrt(d*x + c)*sqrt(d*x - c)*b/d^2

________________________________________________________________________________________

Mupad [B]
time = 3.97, size = 108, normalized size = 1.93 \begin {gather*} \frac {b\,\sqrt {c+d\,x}\,\sqrt {d\,x-c}}{d^2}-\frac {a\,\sqrt {-c}\,\left (\ln \left (\frac {{\left (\sqrt {c+d\,x}-\sqrt {c}\right )}^2}{{\left (\sqrt {-c}-\sqrt {d\,x-c}\right )}^2}+1\right )-\ln \left (\frac {\sqrt {c+d\,x}-\sqrt {c}}{\sqrt {-c}-\sqrt {d\,x-c}}\right )\right )}{c^{3/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*x^2)/(x*(c + d*x)^(1/2)*(d*x - c)^(1/2)),x)

[Out]

(b*(c + d*x)^(1/2)*(d*x - c)^(1/2))/d^2 - (a*(-c)^(1/2)*(log(((c + d*x)^(1/2) - c^(1/2))^2/((-c)^(1/2) - (d*x
- c)^(1/2))^2 + 1) - log(((c + d*x)^(1/2) - c^(1/2))/((-c)^(1/2) - (d*x - c)^(1/2)))))/c^(3/2)

________________________________________________________________________________________